﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;

namespace YJKRevitAxisModule.AxisCut
{
	public class SingleLineFilter : ISelectionFilter
	{
		public bool AllowElement(Element elem)
		{
			if (typeof(Grid) == elem.GetType())
			{
				Line line = (elem as Grid).Curve as Line;
				if (null != line)
				{
					return true;
				}
			}
			else if (typeof(DetailLine) == elem.GetType())
			{
				Line line2 = (elem as DetailLine).GeometryCurve as Line;
				if (null != line2)
				{
					return true;
				}
			}
			else if (typeof(ReferencePlane) == elem.GetType())
			{
				ReferencePlane referencePlane = elem as ReferencePlane;
				if (referencePlane != null)
				{
					return true;
				}
			}
			return false;
		}

		public bool AllowReference(Reference reference, XYZ pos)
		{
			return false;
		}
	}
}
